﻿using System.Linq;
using System.Web.Mvc;
using SlamCms.Common;
using SlamCms.Data;

namespace SlamCms.Sample.Web.Controllers
{
	public class HomeController : Controller
	{
		private readonly SlamCmsContext slamCmsContext;

		public HomeController(SlamCmsContext slamCmsContext)
		{
			this.slamCmsContext = slamCmsContext;
		}

		[HttpGet]
		public ActionResult Index()
		{
			var content = slamCmsContext.CreateQuery(QueryBuilderOptions.AllZones)
										.Get();

			return Content("Content: {0}".F(content.Count()));
		}
	}
}
